import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import Main from '../views/Main.vue'//主体页面

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path: '/',
    redirect: '/main/goods'//重定项
  },
  {
    path: '/main',
    name: 'main',
    component: Main,
    children: [
      { path: 'goods', name: 'goods', component: () => import('../views/main_modules/Goods.vue') },
      {
        path: 'evaluate', name: 'evaluate',
        component: () => import('../views/main_modules/Evaluate.vue'),

      },
      { path: 'merchant', name: 'merchant', component: () => import('../views/main_modules/Merchant.vue') }
    ]
  },
  {
    path: '/detail',
    name: 'detail',
    component: () => import('../views/Detail.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
